package com.fesine.ch02.t1;

/**
 * 方法内的变量为线程安全
 * @Author: Fesine
 * @CreateDate:2016/6/27
 * @UpdateUser:修改人名称
 * @UpdateDate:2016/6/27
 * @UpdateRemark:修改具体的内容
 */
public class HasSelfPrivateNum {
    public void addI(String username) {
        int num =0;
        if (username.equals("a")) {
            num = 100;
            System.out.println("a set over!");
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        } else {
            num =200;
            System.out.println("b set over!");
        }
        System.out.println(username+" num=" + num);
    }
}
